<template>
  <div>
    {{myname}}
    <button @click="handleChange">click</button>
  </div>
</template>
<script>
import { onMounted, onUpdated } from '@vue/runtime-core'
import { ref } from 'vue'
export default {
  setup () {
    onMounted(() => {
      console.log('onMounded')
    })
    onUpdated(() => {
      console.log('onUpdated')
    })

    const myname = ref('孙小双')
    const handleChange = () => {
      myname.value += 1
    }
    return {
      myname, handleChange
    }
  }
}
</script>
